<!DOCTYPE html>
<html>
<head>
    <title>模具档案信息</title>
    #parse("sys/header.html")
    <style>
        .ui-jqgrid {
            width: 88%;
            float: right;
        }
        .sugon_upload_btn {
            display: -webkit-inline-box;
            display: inline-block;
        }
        ::-webkit-scrollbar{
            width: 10px;
            height: 10px;
        }
        ::-webkit-scrollbar-thumb{
            border-radius: 10px;
            -webkit-box-shadow: inset 0 0 5px rgba(0, 0, 0, 0.2);
            background: #a8a5a5;
        }
        .inputDate{
            width: 100%;
        }
    </style>
</head>
<body>
<div id="rrapp" v-cloak>
    <div v-show="showList">
        <Row :gutter="16" style="margin: 8px 0px 0px 1px">
            <div class="search-group">
                <i-col span="3">
                    <i-select v-model="q.moduleSeries" placeholder="模具系列">
                        <i-option v-for="moduleSeries in moduleSeriesList" :value="moduleSeries.seriesCode"
                                  :key="moduleSeries.seriesCode"> {{moduleSeries.seriesCode}}
                        </i-option>
                    </i-select>
                </i-col>
                <i-col span="3">
                    <i-select v-model="q.productModel" @on-enter="query" placeholder="模具机型">
                        <i-option v-for="item in productModelList" :value="item.id" :key="item.modelCode">{{item.complexName}}
                        </i-option>
                    </i-select>
                </i-col>
                <i-col span="3">
                    <i-select v-model="q.dept" placeholder="所属车间">
                        <i-option v-for="item in deptList" :value="item.deptId" :key="item.deptId">{{item.name}}
                        </i-option>
                    </i-select>
                </i-col>
                <i-col span="3">
                    <i-input v-model="q.moduleNo" @on-enter="query" placeholder="模具号"></i-input>
                </i-col>
                <i-col span="3">
                    <i-select v-model="q.currentState" placeholder="模具状态">
                        <i-option v-for="item in currentStateArray" :value="item.value" :key="item.value">
                            {{item.name}}
                        </i-option>
                    </i-select>
                </i-col>
                <i-button @click="query">查询</i-button>
                <i-button @click="reloadSearch">重置</i-button>
            </div>
        </Row>
        <Row :gutter="16" style="margin: 3px 0px 0px 0px;">
            <div class="buttons-group">
                #if($shiro.hasPermission("modulearchives:import"))
                <Upload ref="uploadFile"
                        action="../modulearchives/import"
                        :format="['xlsx','xls']"
                        :before-upload="handleBeforeUpload"
                        :on-success="handleSuccess" :on-error="handleError"
                        :on-format-error="handleFormatError" class="sugon_upload_btn">
                    <i-button type="error"><i class="fa fa-hand-o-down"></i>&nbsp;导入</i-button>
                </Upload>
                #end
                <i-button type="info" @click="modCostStat"><i class="fa fa-industry"></i>&nbsp;模具成本统计</i-button>
                <i-button type="info" @click="goFileList"><i class="fa fa-bars"></i>&nbsp;模具资料</i-button>
                #if($shiro.hasPermission("modulearchives:save"))
                <i-button type="info" @click="add"><i class="fa fa-plus"></i>&nbsp;新增</i-button>
                #end
                #if($shiro.hasPermission("modulearchives:update"))
                <i-button type="warning" @click="update"><i class="fa fa-pencil-square-o"></i>&nbsp;修改</i-button>
                #end

                #if($shiro.hasPermission("modulearchives:modPosition"))
                <i-button type="primary" @click="modPosition"><i class="fa fa-gavel"></i>&nbsp;备件寿命</i-button>
                #end

                #if($shiro.hasPermission("modulearchives:delete"))
                <i-button type="error" @click="del"><i class="fa fa-trash-o"></i>&nbsp;删除</i-button>
                #end
            </div>
        </Row>
        <div style="height: 85vh;width:10%;overflow:auto;float:left;">
            <p class="text-center" style="font-size: 15px;">模具类型</p>
            <div id="storeLayer">
                <ul id="typeTree" class="ztree"></ul>
            </div>
        </div>
        <table id="jqGrid"></table>
    </div>

    <Card v-show="!showList">
        <p slot="title">{{title}}</p>
        <i-form ref="formValidate" :model="moduleArchives" :rules="ruleValidate" :label-width="100">
            <Card>
                <p slot="title">基础信息</p>
                <Row>
                    <i-col span="6">
                        <Form-item label="模具号" prop="moduleNo">
                            <i-input v-model="moduleArchives.moduleNo" placeholder="模具号"></i-input>
                        </Form-item>
                    </i-col>
                    <i-col span="6">
                        <Form-item label="模具类型" prop="moduleTypeName">
                            <i-input v-model="moduleArchives.moduleTypeName" placeholder="模具类型" icon="md-arrow-dropdown-circle"  readonly
                                     @on-click="typeTree"></i-input>
                        </Form-item>
                    </i-col>
                    <i-col span="6">
                        <Form-item label="当前状态" prop="currentState">
                            <i-select v-model="moduleArchives.currentState" placeholder="当前状态">
                                <i-option v-for="item in currentStateArray" :value="item.value" :key="item.value">
                                    {{item.name}}
                                </i-option>
                            </i-select>
                        </Form-item>
                    </i-col>
                    <i-col span="6">
                        <Form-item label="模具机型" prop="productModel">
                            <i-select v-model="moduleArchives.productModel">
                                <i-option v-for="item in productModelList" :value="item.id" :key="item.id">{{ item.modelName }}</i-option>
                            </i-select>
                        </Form-item>
                    </i-col>
                </Row>
                <Row>
                    <i-col span="6" >
                        <Form-item label="现场使用码" prop="liveCode">
                            <i-input v-model="moduleArchives.liveCode" placeholder="现场使用码"></i-input>
                        </Form-item>
                    </i-col>

                    <i-col span="6">
                        <Form-item label="底层编码" prop="lastCode">
                            <i-input v-model="moduleArchives.lastCode" placeholder="MES模次匹配唯一码，格式：NE01F01[0-9]02"></i-input>
                        </Form-item>
                    </i-col>
                    <i-col span="6">
                        <Form-item label="模具系列" prop="moduleSeries">
                            <i-select v-model="moduleArchives.moduleSeries">
                                <i-option v-for="item in moduleSeriesList" :value="item.seriesCode" :key="item.id">{{ item.seriesName }}</i-option>
                            </i-select>
                        </Form-item>
                    </i-col>
                    <i-col span="6">
                        <Form-item label="所在车间" prop="subShopName">
                            <i-input v-model="moduleArchives.subShop" style="display: none"></i-input>
                            <i-input v-model="moduleArchives.subShopName" placeholder="所属车间" icon="md-arrow-dropdown-circle"  readonly
                                     @on-click="deptTreeShow"></i-input>
                        </Form-item>
                    </i-col>
                </Row>
                <Row>
                    <i-col span="6">
                        <Form-item label="模框寿命标准" prop="lifeStandard">
                            <i-input v-model="moduleArchives.lifeStandard" placeholder="模框寿命标准"></i-input>
                        </Form-item>
                    </i-col>
                    <i-col span="6">
                        <Form-item label="模框使用次数" prop="useNo">
                            <i-input v-model="moduleArchives.useNo" placeholder="模框使用次数"></i-input>
                        </Form-item>
                    </i-col>
                    <i-col span="6">
                        <Form-item label="镶块寿命标准" prop="xiangkuaiLifeStandard">
                            <i-input v-model="moduleArchives.xiangkuaiLifeStandard" placeholder="镶块寿命标准"></i-input>
                        </Form-item>
                    </i-col>
                    <i-col span="6">
                        <Form-item label="镶块使用次数" prop="xiangkuaiUseNo">
                            <i-input v-model="moduleArchives.xiangkuaiUseNo" placeholder="镶块使用次数"></i-input>
                        </Form-item>
                    </i-col>
                </Row>
                <Row>
                    <i-col span="6">
                        <Form-item label="模具厂家" prop="moduleManufacturers">
                            <i-input v-model="moduleArchives.moduleManufacturers" placeholder="模具厂家"></i-input>
                        </Form-item>
                    </i-col>
                    <i-col span="6">
                        <Form-item label="镶块厂家" prop="xiangkuaiManufacturers">
                            <i-input v-model="moduleArchives.xiangkuaiManufacturers" placeholder="镶块厂家"></i-input>
                        </Form-item>
                    </i-col>
                    <i-col span="6">
                        <Form-item label="购买时间" prop="buyDate">
                            <Date-picker format="yyyy-MM-dd" v-model="moduleArchives.buyDate" class="inputDate" @on-change="buyDateGetTime"
                                         placeholder="购买时间"></Date-picker>
                        </Form-item>
                    </i-col>
                    <i-col span="6">
                        <Form-item label="量产时间" prop="volumeProductionDate">
                            <Date-picker format="yyyy-MM-dd" v-model="moduleArchives.volumeProductionDate" class="inputDate" @on-change="volumeProductionDateGetTime"
                                         placeholder="量产时间"></Date-picker>
                        </Form-item>
                    </i-col>
                </Row>
                <Row>
                    <i-col span="6" >
                        <Form-item label="固资编号" prop="firmCapitalNo">
                            <i-input v-model="moduleArchives.firmCapitalNo" placeholder="固资编号"></i-input>
                        </Form-item>
                    </i-col>
                    <i-col span="6">
                        <Form-item label="启用时间" prop="startDate">
                            <Date-picker format="yyyy-MM-dd" v-model="moduleArchives.startDate" class="inputDate" @on-change="startDateGetTime"
                                         placeholder="启用时间"></Date-picker>
                        </Form-item>
                    </i-col>
                </Row>
            </Card>
            <Card style="margin-top: 2px">
                <p slot="title">验收状况</p>
                <Row>
                    <i-col span="6" >
                        <Form-item label="初验收时间" prop="volumeProductionDate">
                            <Date-picker format="yyyy-MM-dd" v-model="moduleArchives.initialAcceptDate" class="inputDate" @on-change="ginitialAcceptDateGetStartTime"
                                         placeholder="请选择初验收时间"></Date-picker>
                        </Form-item>
                    </i-col>
                    <i-col span="12" :offset="6">
                        <Form-item label="初验收状况" prop="volumeProductionDate">
                            <i-input :rows="3" type="textarea" v-model="moduleArchives.initialAcceptRemark" placeholder="请输入模具初验收状况"></i-input>
                        </Form-item>
                    </i-col>
                </Row>
                <Row>
                    <i-col span="6">
                        <Form-item label="终验收时间" prop="firmCapitalNo">
                            <Date-picker format="yyyy-MM-dd" v-model="moduleArchives.finalAcceptDate" class="inputDate" @on-change="finalAcceptDateGetTime"
                                         placeholder="请选择终验收时间"></Date-picker>
                        </Form-item>
                    </i-col>
                    <i-col span="12" :offset="6">
                        <Form-item label="终验收状况" prop="firmCapitalNo">
                            <i-input :rows="3" type="textarea" v-model="moduleArchives.finalAcceptRemark" placeholder="请输入模具终验收状况"></i-input>
                        </Form-item>
                    </i-col>
                </Row>
            </Card>
            <Card style="margin-top: 2px">
                <p slot="title">主要变更履历</p>
                <Row>
                    <i-col span="12">
                        <Form-item label="主要变更履历" prop="volumeProductionDate">
                            <i-input :rows="10" type="textarea" v-model="moduleArchives.majorChangeHistory" placeholder="请输入主要变更履历" @on-enter="pointenter(moduleArchives.majorChangeHistory)"
                            ></i-input>
                        </Form-item>
                    </i-col>
                </Row>
            </Card>
            <Card style="margin-top: 2px">
                <p slot="title">报废信息</p>
                <Row>
                    <i-col span="6">
                        <Form-item label="报废时间" prop="startDate">
                            <Date-picker format="yyyy-MM-dd" v-model="moduleArchives.scrapDate" class="inputDate" @on-change="repairScrapDate"
                                         placeholder="请选择报废时间"></Date-picker>
                        </Form-item>
                    </i-col>
                </Row>
                <Row>
                    <i-col span="12" >
                        <Form-item label="模具报废时状况" prop="firmCapitalNo">
                            <i-input :rows="5" type="textarea" v-model="moduleArchives.scrapRemark" placeholder="模具报废时状况"></i-input>
                        </Form-item>
                    </i-col>
                </Row>
            </Card>
            <Form-item style="margin-top: 15px">
                <i-button type="primary" @click="handleSubmit('formValidate')">提交</i-button>
                <i-button type="warning" @click="reload" style="margin-left: 8px">
                返回</i-button>
                <i-button type="info" @click="handleReset('formValidate')" style="margin-left: 8px">重置</i-button>
            </Form-item>
        </i-form>
    </Card>
</div>

<div id="moduleTypeLayer" style="display: none;padding:10px;">
    <ul id="moduleTypeTree" class="ztree"></ul>
</div>

<div id="deptLayer" style="display: none;padding:10px;">
    <ul id="deptTree" class="ztree"></ul>
</div>

<script src="${rc.contextPath}/js/module/modulearchives.js?_${date.systemTime}"></script>
</body>
</html>

